package com.gaofeng.day03;

/**
 * 每个私有化的成员变量都必须提供get和set方法
 */
public class GirlFriend {
    private  String name;
    private int age;
    String gender;

    public void sleep(){
        System.out.println("正在睡觉");
    }
    public void eat(){
        System.out.println("正在吃饭");
    }

    public void setName(String name){
        this.name = name;
    }
    public String getName(){
        return name;
    }

    public void setAge(int num){
        if(num >= 18 && num <= 50){
            age = num;
        }else{
            System.out.println("参数范围不对");
        }
    }

    public int getAge(){
        return age;
    }

}
